package com.shuai.common.constant;

public enum UserStatusEnum {
    NORMAL(0, "正常"),
    LOCKED(1, "锁定");

    private final int statusCode;
    private final String description;

    UserStatusEnum(int statusCode, String description) {
        this.statusCode = statusCode;
        this.description = description;
    }

    public int getStatusCode() {
        return statusCode;
    }

    public String getDescription() {
        return description;
    }

    // Optional: Method to get UserStatus enum from status code
    public static UserStatusEnum fromStatusCode(int statusCode) {
        for (UserStatusEnum status : UserStatusEnum.values()) {
            if (status.getStatusCode() == statusCode) {
                return status;
            }
        }
        throw new IllegalArgumentException("Invalid UserStatus code: " + statusCode);
    }
}
